<template>
  <div :id="id" />
</template>

<script>
import QRCode from 'easyqrcodejs'
import { guid } from '@/utils/index'
export default {
  name: 'QrCode',
  props: {
    options: {
      type: Object,
      default() {
        return {
          text: 'https://www.ejiakanghu.com.cn'
        }
      }
    }
  },
  data() {
    return {
      id: guid()
    }
  },
  created() {
    this.$nextTick(() => {
      new QRCode(document.getElementById(this.id), this.options)
    })
  }
}
</script>

<style scoped>

</style>
